package com.lesama.mstatic;

import com.lesama.domain.Student;

public class StaticDemo1 {
    /*
    * static修饰的成员特点：
    * 1. 被所有成员所共享
    * 2. 可以通过类名调用
    * 3. 优先于对象的存在，始终伴随着类
    * */
    public static void main(String[] args) {
        Student stu1 = new Student();
        stu1.setName("ts");
        stu1.setAge(18);
        Student stu2 = new Student();
        stu2.setName("doinb");
        stu2.setAge(18);
        Student.setSchool("哈基米大学");
        System.out.println(stu1);
        System.out.println(stu2);
        System.out.println(Student.getSchool());
    }
}
